package cn.xiaye.blog.servlet;

import cn.xiaye.blog.bean.Context;
import cn.xiaye.blog.dao.UserDao;
import cn.xiaye.blog.db.util.CommonUtil;

@SuppressWarnings("serial")
public class InsertUser extends FatherServlet {

	@Override
	public String excute(Context context) {
		if(CommonUtil.isNotLogin(context.getSession())){
			return "login.jsp";
		}
		String name = context.getRequest().getParameter("name");
		String password = context.getRequest().getParameter("password");
		UserDao userDao = new UserDao();
		userDao.insert(name, password);
		return "ShowUserPage";
	}
}
